//
//  OADetailDisPatchCell.m
//  OASystem
//
//  Created by zhoupengfei on 15/4/11.
//  Copyright (c) 2015年 zpf. All rights reserved.
//

#import "OADetailDisPatchCell.h"

@implementation OADetailDisPatchCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
    
}

+(instancetype)cellWihtTableView:(UITableView*)tableView{
    NSString * cellIdentifier = @"CellId";
 OADetailDisPatchCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if(cell == nil)
    {
        cell = [[OADetailDisPatchCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];

    }
    return cell;
    
}

-(void)setAllString:(NSString *)allString{
    _allString = allString;
    
    NSArray * tempArray = [allString componentsSeparatedByString:@"##"];
    self.titleLabel.text = [NSString stringWithFormat:@"%@:",tempArray.firstObject];
    if ([tempArray.lastObject isEqualToString:@"null"]) {
         self.desLabel.text = @"";
    }else{
        self.desLabel.text = tempArray.lastObject;
    }
   
}

-(void)editStatus:(BOOL)editor{ //编辑;
    if (editor) {
        self.isEditor = YES;
        if ([self.titleLabel.text rangeOfString:self.detailModel.flow].location != NSNotFound ) {
            self.textView.hidden = NO;
        }else{
            self.textView.hidden = YES;
        }
        
    }else{
        self.isEditor = NO;
        self.textView.hidden = YES;
    }
}

@end
